local skel = fk.CreateSkill {
  name = "lb__chongpao",
}

Fk:loadTranslationTable {
  ["lb__chongpao"] = "虫炮",
  [":lb__chongpao"] = "出牌阶段限一次，你可以视为使用一张无视距离与防具的雷【杀】。",

  ["#lb__chongpao"] = "虫炮：你可以视为使用一张无视距离与防具的雷【杀】",

  ["$lb__chongpao1"] = "",
  ["$lb__chongpao2"] = "",
}

skel:addEffect("viewas", {
  prompt = "#lb__chongpao",
  card_filter = Util.FalseFunc,
  view_as = function(self, player, cards)
    local card = Fk:cloneCard("thunder__slash")
    card.skillName = skel.name
    return card
  end,
  before_use = function(self, player, use)
    use.extraUse = true
    use.extra_data = use.extra_data or {}
    use.extra_data.lb__chongpao = player.id
  end,
  enabled_at_play = function(self, player)
    return player:usedSkillTimes(skel.name, Player.HistoryPhase) == 0
  end,
})

skel:addEffect(fk.TargetSpecified, {
  can_refresh = function(self, event, target, player, data)
    return (data.extra_data or {}).lb__chongpao == player.id and not data.to.dead
  end,
  on_refresh = function(self, event, target, player, data)
    data.to:addQinggangTag(data)
  end,
})

skel:addEffect("targetmod", {
  bypass_times = function (self, player, skill, scope, card, to)
    return card and table.contains(card.skillNames, skel.name)
  end,
  bypass_distances = function(self, player, skill, card, to)
    return card and table.contains(card.skillNames, skel.name)
  end,
})

return skel